app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {

    // 默认路由
    $urlRouterProvider.when('', '/home');


    // 路由规则
    $stateProvider
    .state('home', {
        url: '/home',
        templateUrl: 'home/home.html',
        controller: 'HomeCtrl'
    })
    .state('market', {
        url: '/market',
        templateUrl: 'market/market.html',
        controller: 'MarketCtrl'
    })
    .state('cart', {
        url: '/cart',
        templateUrl: 'cart/cart.html',
        controller: 'CartCtrl'
    })
    .state('mine', {
        url: '/mine',
        templateUrl: 'mine/mine.html',
        controller: 'MineCtrl'
    })



    .state('goodDetail', {
        url: '/goodDetail:id',
        templateUrl: 'common/goodDetail.html',
        controller: 'GoodDetailCtrl'
    })

}])
